pp108 : Defining a New Web Service Source

Defining a New Web Service Source

This topic describes the procedure to create a new Web service source and plug-in the gWeb Service sources to the Web Service Source Generation Wizard.

Process Platform has some predefined Web service sources like Database Metadata, WS-AppServer Package, Data Transformation and so on. The Web Service Generation Wizard lists down the Web Service Sources available. On select, opens the User Interface for the selected Web Service Source and finally creates the web service objects inside CWS. Sometimes you may need to create Web Services on top of sources outside Cordys. In that case create new Web Service Source and plug them into the Web Service Generation wizard.

You can create new Web service source using the Web service generation wizard that performs the following functions:

  • Lists the available Web service sources.
  • Opens the User Interface for the selected Web service source.
  • Creates the Web service objects inside CWS.

The following steps describe the procedure to create a new Web service source:

  1. Right-click the <CWS project> and select Web service source. The Untitled Web service source - Web service source window appears.
  2. Enter the name and description of the source in the Name and Description fields in the Untitled Web service source - Web service source window.
  3. You can create a new XForm or use an existing XForm as the Web service source. Do one of the following:
    • Click and select the relevant XForm from the Select XForm dialog box.
    • Click to create an XForm for the Web service source.
      This form is displayed when this Web service source is selected in the Web service generation wizard.
  4. To plug in the XForm into the Web service generation wizard, ensure that the form has the following functions:
     var definition; function Form_InitDone(eventObject) { definition = application.event.data; //Definition passed by the web service wizard } function validate() { //Validates the form and returns true or false return true; } function getWebserviceDetails() { /* //Returns an array of objects having two values wsdl XML and implementation XML var wsdls = new Array(); var wsdlObject = new Object(); //Set 'wsdl' and 'impl' properties on wsdlObject(Both should be XML Nodes) wsdls.push(wsdlObject); return wsdls; */ } function getApplicationConnectorName() { //Returns the Fully Qualified Application Connector Name } 
    1. The Javascript object passed to the form when opened is Definition and has the following functions:
      1. getName(): Returns the name of the definition set object being created.
      2. isNewObject(): Returns true if definition set object is newly created and returns false if it is already existing in the project.
      3. getSelectedBindingName(): Returns the binding name selected by the user for the existing definition set.
        Will return "" if the definition set object is newly created or the user did not pick an existing binding to generate the Web service.
      4. getSelectedPortTypeName():Returns the port type name selected by the user on the first screen for existing definition set. Will return "" if the definition set object is newly created or the user did not pick an existing port type to generate the web services.
      5. getTargetNamespace(): Returns target Namespace of the definition set.
      6. addXMLSchema(schemaXMLNode, name): Creates XML schema object under the definition set using the schemaXMLNode and the name passed.
        Returns the newly created XMLSchema object and should be used to create the XML schema that the WSDL needs to import.
      7. getXMLSchemas(): Returns an array of schemas under the definition set.
    2. The java script object XMLSchema has the following functions:
      1. getName(): Returns the name of the definition set object being created.
      2. getObjectIdentier(): Returns the object ID of the XML schema object. WSDL can include/import this XML schema using the schema "cws-guid" followed by the object ID. A valid schema location will look like "cws-guid:91F53820-D0E8-11E0-FF32-E186EF98F3E7"
      3. getSchemaAsString(): Returns the XML schema as a string.
      4. updateSchema(schemaXMLNode): Updates the XML schema object with the content of schemaXMLNode.
  5. Publish the Web service source and the XForm.
  6. Launch the Web service generation wizard. The newly created source will be available in the drop down list.
  7. Click Next to open the XForm for the source.
  8. Click Finish. The Web services will be added to the project.
  9. After completing the testing process, the Web service source can be packaged. By installing the Web service source ISVP/CAP, the Web service source will be available on the system.